package com.example.service.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description: 异步导入任务
 * @Author runto
 * @Date 2023/10/14 13:24
 * @PackageName:com.example.service.util
 * @ClassName: ImportTask
 * @Version 1.0
 */
public class ImportTask implements Runnable{

    private static Logger logger = LoggerFactory.getLogger(ImportTask.class);

    @Override
    public void run() {
        try {
            //先休眠5s，确保任务记录已经写进去
            Thread.sleep(5000);
            logger.info("开始进行线路数据导入={}");
            long start=System.currentTimeMillis();
            Thread.sleep(5000);
            long end=System.currentTimeMillis();
            System.out.println("spend time:"+(end-start));
            logger.info("结束线路数据导入={}");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
